package com.ivm.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author ivana
 */
@NamedQueries({
    @NamedQuery(
            name = "User.findByUsernameAndPassword",
            query = "select user from User user where user.username = :username "
            + "and user.password = :password"
    )
})
@Entity
@Table(name = "tbl_user")
public class User {
    
    public static String findByUsernameAndPassword = "User.findByUsernameAndPassword";

    @Id
    @Column(name = "user_id")
    @GeneratedValue
    private Long id;

    @Column(name = "username")
    private String username;

    @Column(name = "password")
    private String password;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }


}
